type Trimed = TrimRight<'  Hello World  '> // 应推导出 '  Hello World'

type TrimRight<T extends string> = T extends `${infer S}${' '}` ? TrimRight<S> : T;